<?php

/**
 * File form base class.
 *
 * @package    FinalsClub
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseFileForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'name'             => new sfWidgetFormInput(),
      'created_at'       => new sfWidgetFormDateTime(),
      'annotate_date'    => new sfWidgetFormInput(),
      'size'             => new sfWidgetFormInput(),
      'description'      => new sfWidgetFormTextarea(),
      'code'             => new sfWidgetFormInput(),
      'link'             => new sfWidgetFormInput(),
      'tags'             => new sfWidgetFormInput(),
      'view_count'       => new sfWidgetFormInput(),
      'download_count'   => new sfWidgetFormInput(),
      'owner_id'         => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'thumbnail'        => new sfWidgetFormInput(),
      'group_id'         => new sfWidgetFormPropelChoice(array('model' => 'Group', 'add_empty' => true)),
      'network_id'       => new sfWidgetFormInput(),
      'course_id'        => new sfWidgetFormInput(),
      'permission_level' => new sfWidgetFormInput(),
      'category'         => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'File', 'column' => 'id', 'required' => false)),
      'name'             => new sfValidatorString(array('max_length' => 255)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'annotate_date'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'size'             => new sfValidatorInteger(),
      'description'      => new sfValidatorString(array('required' => false)),
      'code'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'link'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'tags'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'view_count'       => new sfValidatorInteger(array('required' => false)),
      'download_count'   => new sfValidatorInteger(array('required' => false)),
      'owner_id'         => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'thumbnail'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'group_id'         => new sfValidatorPropelChoice(array('model' => 'Group', 'column' => 'id', 'required' => false)),
      'network_id'       => new sfValidatorInteger(array('required' => false)),
      'course_id'        => new sfValidatorInteger(array('required' => false)),
      'permission_level' => new sfValidatorInteger(array('required' => false)),
      'category'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('file[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'File';
  }


}
